package com.ang.springboot.consumer.work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author ssang
 * @date 2022-04-09 22:23
 */
@Component
public class WorkConsumer {
    //模拟第一个消费者
    @RabbitListener(queuesToDeclare = @Queue("workQueue"))
    public void getMessage1(String msg){
        System.out.println("队列：workQueue；消费者1，开始消费："+msg);
    }

    //模拟第二个消费者
    @RabbitListener(queuesToDeclare = @Queue("workQueue"))
    public void getMessage2(String msg){
        System.out.println("队列：workQueue；消费者2，开始消费："+msg);
    }
}
